package com.vincent.controller.shop;

import com.vincent.common.utils.ResultMapUtil;
import com.vincent.service.HomePageService;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import java.util.Map;

/**
 * 首页以及模板装饰页面控制器
 */
@Controller
@RequestMapping("/index")
public class IndexController {
    @Resource
    private HomePageService homePageService;

    /**
     * 跳转到网站首页
     * @return
     */
    @RequestMapping("/index")
    public String index(HttpServletRequest request){
        Map<String, Object> serviceMap = homePageService.findHomePageShow();
        Object successObj = ResultMapUtil.getSuccessObj(serviceMap);
        request.setAttribute("data",successObj);
        return "/index";
    }



}
